﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Web;
using System.Web.UI;
using BusinessLogic.ClassFactory;
using DataAccess;
using Util.PageInfo;
using ValidateCommon;
using Common;
using BusinessLogic.BusinessRules;
using System.Xml;
using IssueCommon;
using Common.Xml;

namespace RichECMS.ServerPages.Article.Base
{
    public class ArticleSave : Util.BasePage.BasePage
    {
        protected bool CreateSavePage(int intWSID, int intArtSecID, int intSectionID)
        {
            bool bolIssueResult = false;
            XMLProcess objXMLProcess = new XMLProcess( "Setting\\GlobalSet.config");
            string SyncPageBySave = objXMLProcess.ReadAttribute("/configuration/GlobalSet/SyncPageBySave", "Enable");
            if (SyncPageBySave.ToLower() == "true")
            {
                try
                {
                    using (IssueManage objIssueManage = new IssueManage(State.LoginUser))
                    {
                        //文章--发布
                        objIssueManage.SessionUser = State.LoginUser;
                        objIssueManage.IssueArticle(intWSID, intArtSecID, intSectionID);
                        objIssueManage.ClearCaches();
                        bolIssueResult = true;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return bolIssueResult;
        }
    }
}